


const error = function (app) {
    return async (ctx,next)=>{
        try {
            await next();
        }catch (e) {
            app.logger.errLogger.error(e.message);
            ctx.body = {
                err:1,
                msg:'error:' + e.message
            }
        }
    }
};

module.exports = error;
